﻿using ConfExpert.Forms.Base;
using ConfExpert.Utility;
using DevTeam;
using System;
using System.Windows.Forms;

namespace ConfExpert.Forms.SatinAlma.YeniYapi
{
    public partial class YeniMPFoy : XForm
    {
        int VendorId;        
        int POId;

        public YeniMPFoy(int vendorId, int poId)
        {
            InitializeComponent();
            VendorId = vendorId;            
            POId = poId;
        }

        private void YeniPO_Load(object sender, EventArgs e)
        {
            
            bbiHeader.Caption = "PO." + POId.ToString();
            if (VendorId > 0)
                bbiHeader.Caption += "/" + AppSession.Lookups.Vendor.FindByVendorId(VendorId).Name;
        }


        public int POMpFoyId;
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            object notes = DBNull.Value;

            if (txtNotes.Text != "")
                notes = txtNotes.Text;

            POMpFoyId = ExecuteScalar("InsMpFoy", DBNull.Value, WhoAmI, DBNull.Value, notes).ToInt();
          

            this.DialogResult = DialogResult.OK;
        }
    }
}
